Python的一个漏洞导致 使用MinGW来编译包含过pyconfig.h头文件的c++源代码时 会出现“ lib/gcc/i686-pc-mingw32/4.7.2/../../../../include/c++/4.7.2/cmath:1096:11: error: '::hypot' has not been declared ”的错误。绕过方法 就是在c++文件里将 “ #include <cmath> ” 提到所有包含头文件指令的最前面。
http://stackoverflow.com/questions/10660524/error-building-boost-1-49-0-with-gcc-4-7-0
亮点:
Found the answer in this forum post . It seems that pyconfig.h has the following lines:
#if defined(__GNUC__) && defined(_WIN32)
// ...
#define hypot _hypot
// ...
#endif /* GNUC */
but cmath included with MinGW expects the function to be named hypot and not _hypot, which causes the compilation errors.
The fix was to include the following to my bjam command line's cxxflags option
bjam ... cxxflags="-include cmath "
This indicates that g++ should include the cmath header at the beginning of every source file.
杂乱
HxLauncher: Launch Android applications by voice commands